package com.burgeon.backend.Controller;

import com.burgeon.backend.service.RedisService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("redis")
public class RedisController extends BaseController {
    @Autowired
    private RedisService redisService;

    /**
     * 获取缓存的数据
     * @param key
     * @return
     */
    @RequestMapping("getData")
    public List<Map> getRedisData(String key){
        System.err.println(key);
        List<Map> data = redisService.getRedisKey(key);
        return data;
    }
}
